# -*- encoding: utf-8 -*-
##############################################################################
#
#    OpenERP, Open Source Management Solution    
#    Copyright (C) 2003-2010 NS-Team (<http://www.ns-team.fr>). All Rights Reserved
#    $Id$
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import jasper_reports
from osv import osv,fields 
import pooler
import datetime
from mx import DateTime

def orders_detail_sheet( cr, uid, ids, data, context):
#    fo=open("/home/openerp/Desktop/a.txt","w")
#    fo.write(str(data))
#    fo.write("In Order Detail")
#    fo.close()
    try:
        tmp_id=data['form']['ids']        
    except:
        tmp_id=[data['id']]
    return {
      'ids': tmp_id
   }

jasper_reports.report_jasper(
   'report.orders.detail',
   'purchase.order',
   parser=orders_detail_sheet
)